package com.geovis.emergency.spd.controller.pc;


import com.geovis.common.core.api.Result;
import com.geovis.common.core.constant.SwaggerConstants;
import com.geovis.common.core.controller.BaseController;
import com.geovis.emergency.spd.biz.pc.service.IPcDrillPlanTaskService;
import com.geovis.emergency.spd.entity.pc.pojo.dto.PcDrillPlanTaskApprovalDTO;
import com.geovis.emergency.spd.entity.pc.pojo.vo.DrillPlanTaskVO;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 应急预案指挥模块-演练工作方案任务表 前端控制器
 * </p>
 *
 * @author Lonsho
 * @since 2022-06-08
 */
@RestController
@RequestMapping("/pc/drill/plan/task")
public class PcDrillPlanTaskController extends BaseController<IPcDrillPlanTaskService> {
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = SwaggerConstants.LIST_VALUE, notes = SwaggerConstants.LIST_VALUE)
    @PostMapping("/getTaskFeedback/{planId}")
    public Result<DrillPlanTaskVO> getTaskFeedback(@PathVariable("planId") String planId) {
        return Result.ok(baseService.getTaskFeedback(planId));
    }
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "反馈提交审批", notes = "反馈提交审批接口")
    @PostMapping({"/approve"})
    public Result approve(@Validated @RequestBody PcDrillPlanTaskApprovalDTO approvalDTO) {
        baseService.approve(approvalDTO);
        return Result.ok();
    }
}
